package com.mf.service;

import java.sql.Connection;

import com.mf.dao.AdminDao;
import com.mf.daoImpl.AdminDaoImpl;
import com.mf.daoImpl.UserDaoImpl;
import com.mf.entity.Admin;
import com.mf.entity.Picture;
import com.mf.entity.User;
import com.mf.util.DButil;

public class AdminService {
	
	AdminDaoImpl adminDaoImpl=new AdminDaoImpl();
	
	public void add(Admin t){
		adminDaoImpl.add(t);
	}
	
	public void delete(Admin t){
		adminDaoImpl.delete(t);
	}
	
	public void update(Admin t){
		adminDaoImpl.update(t);
	}
	
	public Admin select(Admin t){
		return adminDaoImpl.select(t);
	}

	public boolean adminLogin(String username, String password) {
		Admin admin=adminDaoImpl.selectAdminByAdusername(username);
		if (null==admin) {
			return false;
		}else {
			if (admin.getAdpassword().equals(password)) {
				return true;
			}
		}
		return false;
		
	}

}
